CC=gcc

target=show_gitlog_demo

src=main.c

# $(shell git log -n 1 --pretty=format:"%ad commit id:%H" > timestamp.tmp)
# $(shell sed -i 's#-0700##'  timestamp.tmp)
# $(shell sed -i 's#  #, #'  timestamp.tmp)

# TIMESTAMP:=$(shell git_commit.sh)

TIMESTAMP:=$(shell cat timestamp.tmp)

$(info "TIMESTAMP:"${TIMESTAMP})

export CFLAGS += -DTIMESTAMP="\"${TIMESTAMP}\""

default:
	${CC} -g ${src} ${CFLAGS} -o ${target}

clean:
	rm ${target}